<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>confirm.html</title>
<script>
	var btn;
	var sta;

	window.onload = function() {
		btn = document.getElementById('btnDel');
		sta = document.getElementById('status');

		btn.onclick = clickFunc;//callback함수 호출

	}

	function clickFunc() {
	var flag=confirm("정말 삭제하시겠습니까?");
		if(flag){
			sta.value='파일이 삭제되었습니다.........';
		}else{
			sta.value='작업이 취소되었습니다.........';
			
		}
	}
	
</script>



</head>
<body>

	<input type="button" value='삭제' id='btnDel'>
	<br />
	<output id='status'></output>
</body>
</html>